package servlet;

        import dao.ClassDao;
        import vo.Class;
        import vo.Course;

        import javax.servlet.ServletException;
        import javax.servlet.http.HttpServlet;
        import javax.servlet.http.HttpServletRequest;
        import javax.servlet.http.HttpServletResponse;
        import javax.servlet.http.HttpSession;
        import java.io.IOException;
        import java.util.List;

/**
 * Created by ssw on 2018/6/18.
 */
public class AskClasServlet extends HttpServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ClassDao classDao=new ClassDao();
        List<Class> classList= classDao.askClassList();
        HttpSession session=req.getSession();
        req.setAttribute("classList", classList);
        if(req.getParameter("from")!=null&&req.getParameter("from").equals("admin_addsc"))
            req.getRequestDispatcher("sgms/admin_addsc.jsp").forward(req, resp);
        else
            req.getRequestDispatcher("sgms/admin_adduser.jsp").forward(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
